//------------Sonic CD BGEffects Script-------------//
//--------Scripted by Christian Whitehead 'The Taxman'--------//
//-------Unpacked By Rubberduckycooly's Script Unpacker-------//

//-------Aliases-------//
#alias 16: TYPE_BGEFFECTS


sub ObjectDraw
	TempValue1=Object.Value2
	TempValue2=TileLayer[0].Angle
	if TempValue1<TempValue2
		TempValue3=TempValue2
		TempValue3-=TempValue1
		if TempValue3>256
			TempValue1+=512
		endif
	else
		TempValue3=TempValue1
		TempValue3-=TempValue2
		if TempValue3>256
			TempValue2+=512
		endif
	endif
	TempValue0=TempValue1
	TempValue0-=TempValue2
	Object.Value2=TileLayer[0].Angle
	TempValue0*=131072
	HParallax[0].ScrollPos+=TempValue0
endsub


sub ObjectStartup
	SetMusicTrack("SS3.ogg",0,1)
	SetMusicTrack("SS3Finish.ogg",1,0)
	Stage.XBoundary1=0
	Stage.XBoundary2=133693440
	Stage.YBoundary1=0
	Stage.YBoundary2=133693440
#platform: HW_Rendering
	LoadSpriteSheet("Special/SSMap3.gif")
#endplatform
	ArrayPos0=32
	while ArrayPos0<1056
		if Object[ArrayPos0].Type==TypeName[BGEffects]
			Object[ArrayPos0].Priority=1
			Object[ArrayPos0].DrawOrder=0
			Object[ArrayPos0].Value2=368
		endif
		ArrayPos0++
	loop
endsub

sub RSDK
	LoadSpriteSheet("Global/Display.gif")
	SetEditorIcon(Icon0,SingleIcon,-16,-16,32,32,1,143)
endsub
